/*
 * =====================================================================================
 *
 *       Filename:  mainwindow.cc
 *
 *    Description:  动手吧
 *
 *        Version:  1.0
 *        Created:  12/01/11 21:03:40
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  H_Ley (), kalxd@126.com
 *        Company:  
 *
 * =====================================================================================
 */

#include "mainwindow.h"

MainWindow::MainWindow(GlassWindow *parent):GlassWindow(parent){
	show_glasswindow=new GlassWindow;
	show_glasswindow->resize(300,200);
	QLabel *text_label=new QLabel(tr("Glass Window"));
	text_label->setAlignment(Qt::AlignCenter);
	QVBoxLayout *glasswindow_layout=new QVBoxLayout(show_glasswindow);
	glasswindow_layout->addWidget(text_label);
	show_glasswindow->setLayout(glasswindow_layout);


	close_button=new GlassButton;
	close_button->setText(tr("退出"));
	connect(close_button,SIGNAL(clicked()),SLOT(close()));

	test_button=new QPushButton(tr("弹出窗口"));
	connect(test_button,SIGNAL(clicked()),SLOT(ShowTextGlassWindow()));

	QVBoxLayout *main_layout=new QVBoxLayout;
	//main_layout->addWidget(close_button);
	main_layout->addWidget(test_button);

	setLayout(main_layout);
	resize(400,400);
}
MainWindow::~MainWindow(){
	delete close_button;
	delete show_glasswindow;
	delete test_button;
}

void MainWindow::ShowTextGlassWindow(){
	if(show_glasswindow)
		show_glasswindow->show();
}
